<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for src\assets\scripts\common\validate.js</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../../../prettify.css" />
    <link rel="stylesheet" href="../../../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../../../index.html">all files</a> / <a href="index.html">src/assets/scripts/common/</a> validate.js
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">8.51% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>4/47</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/64</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">50% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>1/2</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">6.52% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>3/46</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">/* eslint-disable complexity */
/* eslint-disable camelcase */
/* eslint-disable wrap-regex */
const GetType = param =&gt; <span class="fstat-no" title="function not covered" >{</span>
<span class="cstat-no" title="statement not covered" >	if (typeof param === 'undefined') {</span>
<span class="cstat-no" title="statement not covered" >		return 'undefined';</span>
	}
<span class="cstat-no" title="statement not covered" >	if (param === null) {</span>
<span class="cstat-no" title="statement not covered" >		return 'null';</span>
	}
	let symStrTag = <span class="cstat-no" title="statement not covered" >Symbol.toStringTag;</span>
<span class="cstat-no" title="statement not covered" >	if (symStrTag &amp;&amp; param[symStrTag]) {</span>
		let strTag = <span class="cstat-no" title="statement not covered" >param[symStrTag];</span>
		let isOwn = <span class="cstat-no" title="statement not covered" >Object.prototype.hasOwnProperty.call(param, symStrTag);</span>
<span class="cstat-no" title="statement not covered" >		if (!Object.getOwnPropertyDescriptor(param, symStrTag).writable) {</span>
<span class="cstat-no" title="statement not covered" >			return Object.prototype.toString.call(param);</span>
		}
<span class="cstat-no" title="statement not covered" >		param[symStrTag] = void 0;</span>
		let result = <span class="cstat-no" title="statement not covered" >Object.prototype.toString.call(param);</span>
<span class="cstat-no" title="statement not covered" >		if (isOwn) {</span>
<span class="cstat-no" title="statement not covered" >			param[symStrTag] = strTag;</span>
		} else {
<span class="cstat-no" title="statement not covered" >			delete param[symStrTag];</span>
		}
<span class="cstat-no" title="statement not covered" >		return result;</span>
	}
<span class="cstat-no" title="statement not covered" >	return Object.prototype.toString.call(param);</span>
};
&nbsp;
let extensionMap = {
	/* ===== List ===== */
	$__utilityList() {
<span class="cstat-no" title="statement not covered" >		return Object.keys(extensionMap);</span>
	},
	/* ===== Simple ===== */
	$isBoolean(param) {
<span class="cstat-no" title="statement not covered" >		return param === true || param === false</span>
			|| this.$isObjectLike(param) &amp;&amp; Object.getPrototypeOf(param) === Boolean.prototype &amp;&amp; GetType(param) === '[object Boolean]';
	},
	$isNumber(param) {
<span class="cstat-no" title="statement not covered" >		return typeof param === 'number'</span>
			|| this.$isObjectLike(param) &amp;&amp; Object.getPrototypeOf(param) === Number.prototype &amp;&amp; GetType(param) === '[object Number]';
	},
	$isInteger(param) {
<span class="cstat-no" title="statement not covered" >		return Number.isInteger(param);</span>
	},
	$isString(param) {
<span class="cstat-no" title="statement not covered" >		return typeof param === 'string'</span>
			|| this.$isObjectLike(param) &amp;&amp; Object.getPrototypeOf(param) === String.prototype &amp;&amp; !this.$isArray(param) &amp;&amp; GetType(param) === '[object String]';
	},
	$isNull(param) {
<span class="cstat-no" title="statement not covered" >		return param === null;</span>
	},
	$isUndefined(param) {
<span class="cstat-no" title="statement not covered" >		return typeof param === 'undefined';</span>
	},
	$isNil(param) {
<span class="cstat-no" title="statement not covered" >		return this.$isNull(param) || this.$isUndefined(param);</span>
	},
	$isObject(param) {
		let type = <span class="cstat-no" title="statement not covered" >typeof param;</span>
<span class="cstat-no" title="statement not covered" >		return param !== null &amp;&amp; (type === 'object' || type === 'function');</span>
	},
	$isObjectLike(param) {
<span class="cstat-no" title="statement not covered" >		return param !== null &amp;&amp; typeof param === 'object';</span>
	},
	$isPlainObject(param) {
		let proto = <span class="cstat-no" title="statement not covered" >Object.getPrototypeOf(Object(param));</span>
<span class="cstat-no" title="statement not covered" >		return this.$isObjectLike(param) &amp;&amp; (proto === Object.prototype || proto === null) &amp;&amp; GetType(param) === '[object Object]';</span>
	},
	$isArray(param) {
<span class="cstat-no" title="statement not covered" >		return Array.isArray(param);</span>
	},
	$isArrayLike(param) {
<span class="cstat-no" title="statement not covered" >		return param !== null &amp;&amp; Number.isSafeInteger(param.length) &amp;&amp; param.length &gt;= 0 &amp;&amp; !this.$isFunction(param);</span>
	},
	$isArrayLikeObject(param) {
<span class="cstat-no" title="statement not covered" >		return this.$isObjectLike(param) &amp;&amp; this.$isArrayLike(param);</span>
	},
	$isFunction(param) {
<span class="cstat-no" title="statement not covered" >		return this.$isObject(param) &amp;&amp; !!~[</span>
			'[object Function]',
			'[object GeneratorFunction]',
			'[object AsyncFunction]',
			'[object Proxy]'
		].indexOf(GetType(param));
	},
	$isSymbol(param) {
<span class="cstat-no" title="statement not covered" >		return typeof param === 'symbol';</span>
	},
	/* ===== Complex ===== */
	$isCellphone(str, isStrict = false) {
<span class="cstat-no" title="statement not covered" >		return (isStrict ? /^(1[3,5,8]\d|14[5,7]|17[0,6,7,8]|19[7])\d{8}$/ : /^1\d{10}$/).test(str);</span>
	},
	$isLengthBetween(str, min, max) {
<span class="cstat-no" title="statement not covered" >		return new RegExp(`^.{${min},${max}}$`).test(str);</span>
	},
	$hasNumber(str) {
<span class="cstat-no" title="statement not covered" >		return /\d/.test(str);</span>
	},
	$hasUpperCase(str) {
<span class="cstat-no" title="statement not covered" >		return /[A-Z]/.test(str);</span>
	},
	$hasLowerCase(str) {
<span class="cstat-no" title="statement not covered" >		return /[a-z]/.test(str);</span>
	},
	// TODO use $isEquivalent
	$isEmpty(param) {
<span class="cstat-no" title="statement not covered" >		return this.$isNil(param)</span>
			|| this.$isArrayLike(param) &amp;&amp; !param.length
			|| (GetType(param) === '[object Map]' || GetType(param) === '[object Set]') &amp;&amp; !param.size
			|| (param === param.constructor.prototype || Object.prototype) &amp;&amp; JSON.stringify(Object.keys(param)) === JSON.stringify(['constructor'])
			|| !Object.keys(param).length
			|| true;
	},
	$isFalsy(param) {
		let jsonStr = <span class="cstat-no" title="statement not covered" >JSON.stringify(param);</span>
<span class="cstat-no" title="statement not covered" >		return !param || jsonStr === '[]' || jsonStr === '{}' || this.$isNumber(param) &amp;&amp; Math.abs(param) &lt; Number.EPSILON;</span>
	}
	/*$isEquivalent(param1, param2) {
		return param1 === param2 ||
			this.$isObjectLike(param1) &amp;&amp; this.$isObjectLike(param2) &amp;&amp; JSON.stringify(param1) === JSON.stringify(param2) ||
			Number.isNaN(param1) &amp;&amp; Number.isNaN(param2);
	}*/
};
&nbsp;
export default {
	install(Vue, options) {
		Object.entries(extensionMap).forEach(([key, val]) =&gt; Vue[key] = Vue.prototype[key] = val);
	}
};
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Jan 16 2018 10:36:09 GMT+0800 (中国标准时间)
</div>
</div>
<script src="../../../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../../../sorter.js"></script>
</body>
</html>
